package com.calsoft.Hops_Mobile_Tablet;
/*
 * User: Minh Diep
 * Date: 6/26/13
 * Time: 2:34 PM
 */


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

public class HomeSectionsPagerAdapter extends FragmentStatePagerAdapter {

    public static final String ARG = "com.calsoft.hops.mobile.home.sections.pager.adapter.arg";

    public HomeSectionsPagerAdapter(FragmentManager fm){
        super(fm);
    }

    @Override
    public Fragment getItem(int i) {
        HomeDailyActivitiesFragment fragment = new HomeDailyActivitiesFragment();
        Bundle bundle = new Bundle();
        String date = (7 + i) < 10? "0" + (7 + i) : String.valueOf(7 + i);

        bundle.putString(ARG, "07/" + date);
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public int getCount() {
        return 7;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        String date = (7 + position) < 10? "0" + (7 + position) : String.valueOf(7 + position);
        return "07/" + date;
    }
}
